import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import nodeResolve from "@rollup/plugin-node-resolve";
import alias from "@rollup/plugin-alias";
const paths = {
    util: "https://esm.sh/util",
    assert: "https://cdn.skypack.dev/assert",
    events: "https://esm.run/events",
    os: "https://esm.run/os",
};
export default {
    input: "./natural/BayesClassifier.js",
    output: {
        file: "dist/BayesClassifier.js",
        format: "es",
        paths,
    },
    plugins: [
        alias({
            entries: {
                fs: "browserfs/dist/shims/fs.js",
            },
        }),
        json(),
        commonjs(),
        nodeResolve(),
        {
            banner() {
                return `
                const require = (module) => {
                    console.log(module);
                };
                const BrowserFS = {
                    BFSRequire(tag) {
                        return {
                            readFile(path, tag, cb) {
                                cb(null, path);
                            },
                        };
                    },
                };`;
            },
        },
    ],
};
